package leetcode.easy.diameterofbinarytree;


import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import util.adt.TreeNode;

public class SolutionTest {
    private static Solution solution;

    @BeforeClass
    public static void setup() {
        solution = new Solution();
    }

    @AfterClass
    public static void tearUp() {
        solution = null;
    }

    @Test
    public void test1() {
        Integer[] nodes = new Integer[]{4, -7, -3, null, null, -9, -3, 9, -7, -4, null, 6, null, -6, -6, null, null, 0,
                6, 5, null, 9, null, null, -1, -4, null, null, null, -2};
        TreeNode root = TreeNode.buildFromArray(nodes);
        Assert.assertEquals(8, solution.diameterOfBinaryTree(root));
    }
}
